#ifndef OA_INPUT_MOUSE_H
#define OA_INPUT_MOUSE_H

#include "libs.h"

namespace input {
	class Mouse	{
	public:
		int mX;
		int mY;

		enum eMouseButton {
			LEFT_BUTTON = 0,
			MIDDLE_BUTTON,
			RIGHT_BUTTON
		};

		bool mButtonPressed[3];
		int mWheel;

		Mouse();
		virtual ~Mouse();

		static void glfwMousePosCallback(int x, int y);
		static void glfwMouseButtonCallback(int button, int state);
		static void glfwMouseWheelCallback(int value);

		struct MouseMoved {
			int mX;
			int mY;

			MouseMoved(int x, int y);
		};

		struct MouseLeftButtonPressed {};
		struct MouseMiddleButtonPressed {};
		struct MouseRightButtonPressed {};

		struct MouseLeftButtonReleased {};
		struct MouseMiddleButtonReleased {};
		struct MouseRightButtonReleased {};

		struct MouseWheel {
			int mValue;

			MouseWheel(int value);
		};

		void handle(const MouseMoved& mm);

		void handle(const MouseLeftButtonPressed&);
		void handle(const MouseMiddleButtonPressed&);
		void handle(const MouseRightButtonPressed&);

		void handle(const MouseLeftButtonReleased&);
		void handle(const MouseMiddleButtonReleased&);
		void handle(const MouseRightButtonReleased&);

		void handle(const MouseWheel& mw);
	};
}

#endif
